package com.cain.calendar.tool;

import android.content.Context;
import android.os.Build;

import com.cain.calendar.R;

import java.util.ArrayList;

/**
 * Created by Cain on 2016/6/25.
 * 全局变量类
 */
public class Constant {

    public static final int getColor(Context context, int id) {
        final int version = Build.VERSION.SDK_INT;
        if (version >= 23) {
            return context.getResources().getColor(id, null);
        } else {
            return context.getResources().getColor(id);
        }
    }

    private static String[] baseTag = {"普通", "重要", "会议", "学习", "约会", "外出", "聚会", "生日"};
    public static ArrayList<String> tagList;   //事件标签列表
    static {
        tagList = new ArrayList<>();
        for (int i = 0; i < baseTag.length; ++i)
            tagList.add(baseTag[i]);
    }

    public static final String DATABASE_NAME = "calendar.db";   //数据库名称
    public static final String EVENT_TABLE_NAME = "event_table";   //事件表名称

    public static final int[] colors = {R.color.color1,
            R.color.color2,
            R.color.color3,
            R.color.color4,
            R.color.color5,
            R.color.color6,
            R.color.color7 };

    public static final String[] weekdayName = {"周日", "周一", "周二", "周三", "周四", "周五", "周六"};
}
